<#assign base=request.contextPath>
<!DOCTYPE html> 
<html>
	<head>
		<title>${title}</title>
		<meta charset="utf-8">
		<#include "common/reference.ftl" />
		<#include "common/ligerui.ftl" />
		<#include "common/am.reference.ftl" />
	</head>
	<body class="${configs["skinName"]}">
		<div class="page-content">
			<div class="row">
			<#if viewMode !="view">
			<#include "common/breadcrumb.ftl">
			</#if>
				<form id="form" role="form" class="form-horizontal" method="post" action="${base}/${form_action}">
					<div class="col-xs-12">
						<div class="widget-box">
							<div class="widget-body">
								<input type="hidden" name="regionId" id="regionId" value="${model.regionId}" <#if viewMode == "view">disabled</#if>>
								<#if viewMode == "view">
								<div class="widget-header widget-header-flat">
									<h5 class="lighter">
										${module}
									</h5>
								</div>
								<#else>
								<div class="alert alert-warning">
									<strong>提示!</strong>
									<strong style="color:#dd514c;">出现红框</strong>的表示不能为空
								</div>
								</#if>
								<div class="form-group">
									<label class="col-sm-3 control-label no-padding-right">
										父级地区
									</label>
									<div class="col-sm-6">
										<input id="txtParentId" class="form-control" type="text" placeholder="请选择父级地区" value="" required  <#if viewMode == "view">disabled</#if> />
									</div>
								</div>
								<div class="form-group">
									<label class="col-sm-3 control-label no-padding-right">
										地区名称
									</label>
									<div class="col-sm-6">
										<input type="text" class="form-control" id="regionName" name="regionName" value="${model.regionName}" placeholder="请输入地区名称" required <#if viewMode == "view">disabled</#if>/>	
									</div>
								</div>
								<div class="form-group">
                                    <label class="col-sm-3 control-label no-padding-right">
                                        地区编码
                                    </label>
                                    <div class="col-sm-6">
                                        <input type="text" class="form-control" id="regionCode" name="regionCode" value="${model.regionCode}" placeholder="请输入地区编码" required <#if viewMode == "view">disabled</#if>/>
                                    </div>
                                </div>
								<div class="form-group">
									<label class="col-sm-3 control-label no-padding-right">
										地区名称首字母
									</label>
									<div class="col-sm-6">
										<input type="text" class="form-control" id="firstLetter" name="firstLetter" value="${model.firstLetter}" placeholder="请输入地区名称首字母，如安徽=A" required <#if viewMode == "view">disabled</#if>/>	
									</div>
								</div>
								<div class="form-group">
									<label class="col-sm-3 control-label no-padding-right">
										是否启用
									</label>
									<div class="col-sm-6">
										<input class="ace ace-switch ace-switch-7" type="checkbox" name="enabled" <#if model == null || model.enabled>checked="checked"</#if> <#if viewMode == "view">disabled</#if>>
										<span class="lbl"></span>
									</div>
								</div>
								<#if viewMode != "view">
								<div class="clearfix form-actions">
									<div class="col-md-offset-3 col-md-9">
										<button id="btnSubmit" class="btn btn-info" type="submit">
											<i class="fa fa-check bigger-110"></i>
											提 交
										</button>
									</div>
								</div>
								</#if>
							</div>
						</div>
					</div>
				</form>
			</div>	
		</div>
		<script type="text/javascript">
		$(function(){
			var ligerComboBox = $('#txtParentId').ligerComboBox({
				width:180,
				selectBoxWidth: 200,
        		selectBoxHeight: 200,
				initValue:'${model.parentId}',
				valueField:'regionId',
				valueFieldID:'parentId',
				textField:'regionName',
				treeLeafOnly:false,
				isShowCheckBox:false,
				tree:{
					url:'${base}/${route}/getTreeList',
				 	textFieldName:'regionName',
				 	idFieldName:'regionId',
				 	parentIDFieldName:'parentId',
				 	checkbox:false
				},
				onSelected:function(value){
					$('#parentId').val(value);
				}
			});
			$('#form').validator();
		})
		</script>
	</body>
</html>